package org.apcs.pokemon.mechanics;

/**
 * Author:          Zachary Reed
 * Date Created:    Mar 24, 2010
 * Last Modified:   Apr 14, 2010
 * Package:         org.apcs.pokemon.mechanics
 * Filename:        Move.java
 * Description:     A class that defines all of the moves available to pokemon,
 *                  and defines methods to assist in using said moves. Moves
 *                  are stored in an array with their index in the array equal
 *                  to the index given on Bulbapedia. Move lists for pokemon
 *                  should use this index, not the name of the move, to define
 *                  moves available for that pokemon.
 */

/**
 * TODO: Add remaining moves to array.
 * TODO: Update moves to include move category.
 */

public class Move {

    /** Move name. ("-" = no name) */
	private String strName;

    /** Move type. (-1 = no type) */
	private int intType;

    /** Move power points. (-1 = no PP) */
	private int intPP;

    /** Move maximum power points. (-1 = no max PP) */
	private int intMaxPP;

    /** Move base damage. (-1 = no damage) */
	private int intPower;

    /** Move accuracy. (-1 = no accuracy) */
	private int intAccuracy;

	/**
     * Creates a new Move object. (Only used to create array of moves below.)
     * @param name Name of move
     * @param type Type of move
     * @param pp Max PP of move
     * @param pwr Base damage of move
     * @param acc Accuracy of move
     */
	private Move(String name,int type,int pp,int pwr,int acc) {
		strName = name;
		intType = type;
		intPP = pp;
		intMaxPP = pp;
		intPower = pwr;
		intAccuracy = acc;
	}

	/**
     * Create the move at the specified index. (Move must be predefined.)
     * @param index Index of move to create
     */
	public Move(int index) {
		strName = arrMoveList[index].getName();
		intType = arrMoveList[index].getType();
		intPP = arrMoveList[index].getMaxPP();
		intMaxPP = arrMoveList[index].getMaxPP();
		intPower = arrMoveList[index].getPower();
		intAccuracy = arrMoveList[index].getAccuracy();
	}

	/**
     * @deprecated
     * Create a move with the name specified. (Move must be predefined.)
     *
     * (Don't use this, use Move(index) instread.)
     * @param name Name of move
     */
	public Move(String name) {
		for (int i=0;i<arrMoveList.length;i++) {
			if (arrMoveList[i].getName().equals(name)) {
				strName = arrMoveList[i].getName();
				intType = arrMoveList[i].getType();
				intPP = arrMoveList[i].getMaxPP();
				intMaxPP = arrMoveList[i].getMaxPP();
				intPower = arrMoveList[i].getPower();
				intAccuracy = arrMoveList[i].getAccuracy();
				break;
			}
		}
	}

	/**
     * Return the name of the move.
     * @return The move's name.
     */
	public String getName() {return strName;}

    /**
     * Return the type of the move.
     * @return The move's type.
     */
	public int getType() {return intType;}

    /**
     * Return the current PP of the move.
     * @return The move's current PP.
     */
	public int getPP() {return intPP;}

    /**
     * Return the maximum PP of the move.
     * @return The move's maximum PP.
     */
	public int getMaxPP() {return intMaxPP;}

    /**
     * Return the base damage of the move.
     * @return The move's base damage.
     */
	public int getPower() {return intPower;}

    /**
     * Return the accuracy of the move.
     * @return The move's accuracy.
     */
	public int getAccuracy() {return intAccuracy;}

	/** Array defining available moves. */
	public static final Move[] arrMoveList = {
		new Move("-",-1,-1,-1,-1),						// 0
		new Move("Pound",0,35,40,100),					// 1
		new Move("Karate Chop",6,25,50,100),
		new Move("DoubleSlap",0,10,15,85),
		new Move("Comet Punch",0,15,18,85),
		new Move("Mega Punch",0,20,80,85),
		new Move("Pay Day",0,20,40,100),
		new Move("Fire Punch",1,15,75,100),
		new Move("Ice Punch",5,15,75,100),
		new Move("ThunderPunch",4,15,75,100),
		new Move("Scratch",0,35,40,100),				// 10
		new Move("ViceGrip",0,30,55,100),
		new Move("Guillotine",0,5,255,30),
		new Move("Razor Wind",0,10,80,100),
		new Move("Swords Dance",0,30,-1,-1),
		new Move("Cut",0,30,50,95),
		new Move("Gust",9,35,40,100),
		new Move("Wing Attack",9,35,60,100),
		new Move("Whirlwind",0,20,-1,100),
		new Move("Fly",9,15,90,95),
		new Move("Bind",0,20,15,75),					// 20
		new Move("Slam",0,20,80,75),
		new Move("Vine Whip",3,15,35,100),
		new Move("Stomp",0,20,65,100),
		new Move("Double Kick",6,30,30,100),
		new Move("Mega Kick",0,5,120,75),
		new Move("Jump Kick",6,25,85,95),
		new Move("Rolling Kick",6,15,60,85),
		new Move("Sand-Attack",8,15,-1,100),
		new Move("Headbutt",0,15,70,100),
		new Move("Horn Attack",0,25,65,100),			// 30
		new Move("Fury Attack",0,20,15,85),
		new Move("Horn Drill",0,5,255,30),
		new Move("Tackle",0,35,35,95),
		new Move("Body Slam",0,15,85,100),
		new Move("Wrap",0,20,15,85),
		new Move("Take Down",0,20,90,85),
		new Move("Thrash",0,20,90,100),
		new Move("Double-Edge",0,15,120,100),
		new Move("Tail Whip",0,30,-1,100),
		new Move("Poison Sting",7,35,15,100),			// 40
		new Move("Twineedle",11,20,25,100),
		new Move("Pin Missile",11,20,14,85),
		new Move("Leer",0,30,-1,100),
		new Move("Bite",15,25,60,100),
		new Move("Growl",0,40,-1,100),
		new Move("Roar",0,20,-1,100),
		new Move("Sing",0,15,-1,55),
		new Move("Supersonic",0,20,-1,55),
		new Move("SonicBoom",0,20,20,90),
		new Move("Disable",0,20,-1,80),					// 50
		new Move("Acid",7,30,40,100),
		new Move("Ember",1,25,40,100),
		new Move("Flamethrower",1,15,95,100),
		new Move("Mist",5,30,-1,-1),
		new Move("Water Gun",2,25,40,100),
		new Move("Hydro Pump",2,5,120,80),
		new Move("Surf",2,15,95,100),
		new Move("Ice Beam",5,10,95,100),
		new Move("Blizzard",5,5,120,70),
		new Move("Psybeam",10,20,65,100),				// 60
		new Move("BubbleBeam",2,20,65,100),
		new Move("Aurora Beam",5,20,65,100),
		new Move("Hyper Beam",0,5,150,90),
		new Move("Peck",9,35,35,100),
		new Move("Drill Peck",9,20,80,100),
		new Move("Submission",6,25,80,80),
		new Move("Low Kick",6,20,-1,100),
		new Move("Counter",6,20,-1,100),
		new Move("Seismic Toss",6,20,-1,100),
		new Move("Strength",0,15,80,100),				// 70
		new Move("Absorb",3,25,20,100),
		new Move("Mega Drain",3,15,40,100),
		new Move("Leech Seed",3,10,-1,90),
		new Move("Growth",0,40,-1,-1),
		new Move("Razor Leaf",3,25,55,95),
		new Move("SolarBeam",3,10,120,100),
		new Move("PoisonPowder",7,35,-1,75),
		new Move("Stun Spore",3,30,-1,75),
		new Move("Sleep Powder",3,15,-1,75),
		new Move("Petal Dance",3,20,90,100),			// 80
		new Move("String Shot",11,40,-1,95),
		new Move("Dragon Rage",14,10,-1,100),
		new Move("Fire Spin",1,15,15,70),
		new Move("ThunderShock",4,30,40,100),
		new Move("Thunderbolt",4,15,95,100),
		new Move("Thunder Wave",4,20,-1,100),
		new Move("Thunder",4,10,120,70),
		new Move("Rock Throw",12,15,50,90),
		new Move("Earthquake",8,10,100,100),
		new Move("Fissure",8,5,255,30),					// 90
		new Move("Dig",8,10,80,100),
		new Move("Toxic",7,10,-1,85),
		new Move("Confusion",10,25,50,100),
		new Move("Psychic",10,10,90,100),
		new Move("Hypnosis",10,20,-1,60),
		new Move("Meditate",10,40,-1,-1),
		new Move("Agility",10,30,-1,-1),
		new Move("Quick Attack",0,30,40,100),
		new Move("Rage",0,20,20,100),
		new Move("Teleport",10,20,-1,-1),				// 100
		new Move("Night Shade",13,15,-1,100),
		new Move("Mimic",0,10,-1,100),
		new Move("Screech",0,40,-1,85),
		new Move("Double Team",0,15,-1,-1),
		new Move("Recover",0,10,-1,-1),
		new Move("Harden",0,30,-1,-1),
		new Move("Minimize",0,20,-1,-1),
		new Move("SmokeScreen",0,20,-1,100),
		new Move("Confuse Ray",13,10,-1,100),
		new Move("Withdraw",2,40,-1,-1),				// 110
		new Move("Defense Curl",0,40,-1,-1),
		new Move("Barrier",10,30,-1,-1),
		new Move("Light Screen",10,30,-1,-1),
		new Move("Haze",5,30,-1,-1),
		new Move("Reflect",10,20,-1,-1),
		new Move("Focus Energy",0,30,-1,-1),
		new Move("Bide",0,10,-1,100),
		new Move("Metronome",0,10,-1,-1),
		new Move("Mirror Move",9,20,-1,-1),
		new Move("Selfdestruct",0,5,200,100),			// 120
		new Move("Egg Bomb",0,10,100,75),
		new Move("Lick",13,30,20,100),
		new Move("Smog",7,20,20,70),
		new Move("Sludge",7,20,65,100),
		new Move("Bone Club",8,20,65,85),
		new Move("Fire Blast",1,5,120,85),
		new Move("Waterfall",2,15,80,100),
		new Move("Clamp",2,10,35,75),
		new Move("Swift",0,20,60,-1),
		new Move("Skull Bash",0,15,100,100),			// 130
		new Move("Spike Cannon",0,15,20,100),
		new Move("Constrict",0,35,10,100),
		new Move("Amnesia",10,20,-1,-1),
		new Move("Kinesis",10,15,-1,80),
		new Move("Softboiled",0,10,-1,100),
		new Move("Hi Jump Kick",6,20,100,90),
		new Move("Glare",0,30,-1,75),
		new Move("Dream Eater",10,15,100,100),
		new Move("Poison Gas",7,40,-1,55),
		new Move("Barrage",0,20,15,85),					// 140
		new Move("Leech Life",11,15,20,100),
		new Move("Lovely Kiss",0,10,-1,75),
		new Move("Sky Attack",9,5,140,90),
		new Move("Transform",0,10,-1,-1),
		new Move("Bubble",2,30,20,100),
		new Move("Dizzy Punch",0,10,70,100),
		new Move("Spore",3,15,-1,100),
		new Move("Flash",0,20,-1,100),
		new Move("Psywave",10,15,-1,80),
		new Move("Splash",0,40,-1,-1),					// 150
		new Move("Acid Armor",7,40,-1,-1),
		new Move("Crabhammer",2,10,90,85),
		new Move("Explosion",0,5,250,100),
		new Move("Fury Swipes",0,15,18,80),
		new Move("Bonemerang",8,10,50,90),
		new Move("Rest",10,10,-1,-1),
		new Move("Rock Slide",12,10,75,90),
		new Move("Hyper Fang",0,15,80,90),
		new Move("Sharpen",0,30,-1,-1),
		new Move("Conversion",0,30,-1,-1),				// 160
		new Move("Tri Attack",0,10,80,100),
		new Move("Super Fang",0,10,-1,90),
		new Move("Slash",0,20,70,100),
		new Move("Substitute",0,10,-1,-1),
		new Move("Struggle",0,1,50,100)					// 166
	};
}
